package ewa.big.gameapi;

import java.io.Serializable;
import java.util.Random;

/**
 * <b>Web Engineering - UE3</b>
 * <p>
 *
 * This class represents a dice for the "Mensch aergere Dich nicht" game.
 * 
 * @version 1.00 (01.05.2012)
 */
public class Dice implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * Object used to generate pseudorandom generated numbers that represent
     * the score thrown by rolling this dice
     */
    Random random;
    
    /**
     * C'tor - Creates a new dice.
     */
    public Dice(){
        random = new Random();
    } // end C'tor
    
    /**
     * Rolls the dice, i.e., specifies the score thrown using the dice.
     * 
     * @return score thrown
     */
    public int roll(){
        return random.nextInt(6)+1;
    } // end roll
    
} // end of class Dice
